package com.mvp.lt.airlineview.data.source;



import com.mvp.lt.airlineview.data.constant.ADStatus;
import com.mvp.lt.airlineview.data.entity.AdvertData;
import com.mvp.lt.airlineview.data.entity.MyAtentionBean;
import com.mvp.lt.airlineview.data.entity.MyFansBean;
import com.mvp.lt.airlineview.data.event.ADTabTypeBean;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * $activityName
 *
 * @author LiuTao
 * @date 2019/3/16/016
 */
public class DataServer {
    /**
     * 广告列表数据
     *
     * @param adStatus
     * @return
     */
    public static List<AdvertData> getADListdata(ADStatus adStatus) {
        List<AdvertData> list = new ArrayList<>(30);
        for (int i = 0; i < 30; i++) {
            AdvertData advertData = new AdvertData();
            if (i % 2 == 0) {
                advertData.setCompany("长沙派无界网络科技");
                advertData.setDistance("0.9KM");
                advertData.setMoney("5");
                advertData.setTime("03-13 13:25");
                advertData.setStatus(adStatus.getStatus());
                advertData.setTitle("支付宝设计中心：超级营销“集背后的设计体系系系系系系系系系");
                list.add(advertData);
            } else {
                advertData.setCompany("长沙派无界网络科技");
                advertData.setDistance("0.6KM");
                advertData.setMoney("10");
                advertData.setStatus(adStatus.getStatus());
                advertData.setTime("03-12 10:25");
                advertData.setTitle("活动行业互相碰撞，谁能更胜一筹...");
                list.add(advertData);
            }
        }
        return list;
    }

    /**
     * 我的关注
     *
     * @return
     */
    public static List<MyAtentionBean> getAtentionListdata() {
        List<MyAtentionBean> list = new ArrayList<>(30);
        for (int i = 0; i < 30; i++) {
            MyAtentionBean advertData = new MyAtentionBean();
            if (i % 2 == 0) {
                advertData.setName("长沙派无界网络科技" + i);
                advertData.setAddress("长沙市芙蓉区东沌渡街道");
                advertData.setImgPath("5");
                list.add(advertData);
            } else {
                advertData.setName("长沙派无界网络科技" + i);
                advertData.setAddress("长沙市芙蓉区东沌渡街道");
                advertData.setImgPath("5");
                list.add(advertData);
            }
        }
        return list;
    }

    /**
     * 我的粉丝
     *
     * @return
     */
    public static List<MyFansBean> getFansListdata() {
        List<MyFansBean> list = new ArrayList<>(30);
        for (int i = 0; i < 30; i++) {
            MyFansBean fansBean = new MyFansBean();
            switch (i % 3) {
                case 0:
                    fansBean.setName("习大大");
                    fansBean.setAddress("长沙市");
                    fansBean.setImgPath("5");
                    fansBean.setAge("45");
                    fansBean.setOtherInfo("总理");
                    fansBean.setSex("男");
                    list.add(fansBean);
                    break;
                case 1:
                    fansBean.setName("刘德华");
                    fansBean.setAddress("北京市");
                    fansBean.setImgPath("5");
                    fansBean.setAge("40");
                    fansBean.setSex("男");
                    fansBean.setOtherInfo("歌手/演员");
                    list.add(fansBean);
                    break;
                case 2:
                    fansBean.setName("刘诗诗");
                    fansBean.setAddress("香港市");
                    fansBean.setImgPath("5");
                    fansBean.setAge("35");
                    fansBean.setSex("女");
                    fansBean.setOtherInfo("歌手/演员");
                    list.add(fansBean);
                    break;
                default:
                    break;
            }

        }
        return list;
    }
    /**
     * 生成一个0 到 count 之间的随机数
     *
     * @param endNum
     * @return
     */
    public static int getNum(int endNum) {
        if (endNum > 0) {
            Random random = new Random();
            return random.nextInt(endNum);
        }
        return 0;
    }

    public static ADStatus getADStatus(int number) {
        ADStatus adStatus;
        switch (number) {
            case 0:
                adStatus = ADStatus.AD_IN_RELEASE;
                break;
            case 1:
                adStatus = ADStatus.AD_CHECK_PENDING;
                break;
            case 2:
                adStatus = ADStatus.AD_TOBE_ANNOUNCED;
                break;
            case 3:
                adStatus = ADStatus.AD_WITHDRAWN;
                break;
            case 4:
                adStatus = ADStatus.AD_REJECTED;
                break;
            case 5:
                adStatus = ADStatus.AD_COMPLETED;
                break;
            case 6:
                adStatus = ADStatus.AD_OFF_SHELF;
                break;
            case 7:
                adStatus = ADStatus.AD_DELETED;
                break;
            default:
                adStatus = ADStatus.UN_KNOWN;
                break;
        }
        return adStatus;
    }

    public static List<ADTabTypeBean.DataBean> getMoreADTypeList() {
        List<ADTabTypeBean.DataBean> list = new ArrayList<>();
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));

        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        list.add(new ADTabTypeBean.DataBean(1, "保险业", 0));
        return list;
    }
}
